<?php
/*
底部菜单-管理页面类
*/
class manageAppClass extends app{
	/*菜单*/
	public function menu(){
		//参数
		$json['menu'] = array(
			array(
				"name" => "行政人事",//一级菜单名称
				"array" => array(
					array(
						"name" => "角色管理",//二级菜单名称
						"key" => "role",//关键词
						"ico" => root."img/svg/role.svg",//图标
						"power" => array("role","see"),//权限
					),
					array(
						"name" => "部门管理",
						"key" => "department",
						"ico" => root."img/svg/department.svg",
						"power" => array("department","see"),
					),
					array(
						"name" => "职位管理",
						"key" => "job",
						"ico" => root."img/svg/job.svg",
						"power" => array("job","see"),
					),
					array(
						"name" => "员工管理",
						"key" => "staff",
						"ico" => root."img/svg/staff.svg",
						"power" => array("staff","see"),
					),
					array(
						"name" => "工作日",
						"key" => "workDay",
						"ico" => root."img/svg/workDay.svg",
						"power" => array("workDay","see"),
					),
					array(
						"name" => "加班记录",
						"key" => "workAdd",
						"ico" => root."img/svg/workAdd.svg",
						"power" => array("workAdd","seeAll"),
					),
					array(
						"name" => "请假记录",
						"key" => "work",
						"ico" => root."img/svg/work.svg",
						"power" => array("work","seeAll"),
					),
					array(
						"name" => "外出记录",
						"key" => "workOut",
						"ico" => root."img/svg/workOut.svg",
						"power" => array("workOut","seeAll"),
					),
					array(
						"name" => "补卡单",
						"key" => "workSignAdd",
						"ico" => root."img/svg/workSignAdd.svg",
						"power" => array("workSignAdd","seeAll"),
					),
					array(
						"name" => "考勤记录",
						"key" => "workSign",
						"ico" => root."img/svg/workSign.svg",
						"power" => array("workSign","seeAll"),
					),
					array(
						"name" => "行政处罚",
						"key" => "penalty",
						"ico" => root."img/svg/penalty.svg",
						"power" => array("staff","penalty"),
					),
				),
			),
			array(
				"name" => "财务管理",
				"array" => array(
					array(
						"name" => "收支平衡",
						"key" => "profit",
						"ico" => root."img/svg/profit.svg",
						"power" => array("profit","see"),
					),
					array(
						"name" => "分类统计",
						"key" => "profitTotal",
						"ico" => root."img/svg/profitTotal.svg",
						"power" => array("profit","seeAll"),
					),
					array(
						"name" => "收支曲线",
						"key" => "profitCurve",
						"ico" => root."img/svg/profitCurve.svg",
						"power" => array("profit","seeAll"),
					),
					array(
						"name" => "员工数曲线",
						"key" => "staffNum",
						"ico" => root."img/svg/staffNum.svg",
						"power" => array("profit","seeAll"),
					),
					array(
						"name" => "费用报销",
						"key" => "cost",
						"ico" => root."img/svg/cost.svg",
						"power" => array("cost","seeAll"),
					),
					array(
						"name" => "开票记录",
						"key" => "kehuInvoice",
						"ico" => root."img/svg/kehuInvoice.svg",
						"power" => array("kehuInvoice","seeAll"),
					),
					array(
						"name" => "团队基金",
						"key" => "teamFund",
						"ico" => root."img/svg/teamFund.svg",
						"power" => array("teamFund","see"),
					),
				),
			),
			array(
				"name" => "客户管理",
				"array" => array(
					array(
						"name" => "新建客户",
						"key" => "clientNew",
						"ico" => root."img/svg/clientNew.svg",
						"power" => array("client","edit"),
					),
					array(
						"name" => "介绍客户",
						"key" => "clientShare",
						"ico" => root."img/svg/clientShare.svg",
						"power" => array("client","share"),
					),
					array(
						"name" => "客户列表",
						"key" => "client",
						"ico" => root."img/svg/client.svg",
						"power" => array("client","see"),
					),
//					array(
//						"name" => "新建订单",
//						"key" => "orderNew",
//						"ico" => root."img/svg/orderNew.svg",
//						"power" => array("order","edit"),
//					),
					array(
						"name" => "订单列表",
						"key" => "order",
						"ico" => root."img/svg/order.svg",
						"power" => array("order","see"),
					),
					array(
						"name" => "业务技能",
						"key" => "clientTalk",
						"ico" => root."img/svg/clientTalk.svg",
						"power" => array("clientTalk","see"),
					),
				),
			),
			array(
				"name" => "知识管理",
				"array" => array(
					array(
						"name" => "办公文件",
						"key" => "fileWork",
						"ico" => root."img/svg/fileWork.svg",
						"power" => array("fileWork","see"),
					),
					array(
						"name" => "附件管理",
						"key" => "file",
						"ico" => root."img/svg/file.svg",
						"power" => array("file","see"),
					),
					array(
						"name" => "跟进记录",
						"key" => "follow",
						"ico" => root."img/svg/follow.svg",
						"power" => array("follow","see"),
					),
				),
			),
			array(
				"name" => "系统设置",
				"array" => array(
					array(
						"name" => "系统日志",
						"key" => "log",
						"ico" => root."img/svg/log.svg",
						"power" => array("log","see"),
					),
					array(
						"name" => "帮助中心",
						"key" => "adHelp",
						"ico" => root."img/svg/adHelp.svg",
						"power" => array("adHelp","see"),
					),
				),
			),
		);
		//判断
		foreach($json['menu'] as $oneNum => $one){
			foreach($one['array'] as $num => $array){
				if($this->power($array['power'][0],$array['power'][1])){
					unset($json['menu'][$oneNum]['array'][$num]['power']);
				}else{
					unset($json['menu'][$oneNum]['array'][$num]);
				}
			}
			if(count($json['menu'][$oneNum]['array']) == 0){
				unset($json['menu'][$oneNum]);
			}
		}
		//数组排序
		foreach($json['menu'] as $oneNum => $one){
			$json['menu'][$oneNum]['array'] = array_values($one['array']);
		}
		$json['menu'] = array_values($json['menu']);
		//返回
		$json['warn'] = "success";
		return $json;
	}
}
?>